﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ModbusTestTool
{
    class SWord:BaseRegisterGeneric<Int16>
    {
        public SWord(string name, int register)
            : base(name, register)
        { }

        public override int size
        {
            get { return 1; }
        }

        public override void setValue(ushort[] words)
        {
            lock (lockVariable)
            {
                m_result = Convert.ToInt16(words[baseRegister]);
                NotifyPropertyChanged("value");
            }
        }

        public override void getValue(ushort[] words)
        {
            lock (lockVariable)
            {
                words[baseRegister] = Convert.ToUInt16(m_result);
            }
        }

    }
}
